package com.ydd.mapper;

import com.ydd.entity.Config;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydd.entity.SysConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hgz
 * @since 2023-05-30
 */
@Mapper
public interface ConfigMapper extends BaseMapper<Config> {


    @Select("select attr_value from sys_config where attr_key = #{system}")
    String getConfig(String system);

    @Select("select tab_value from sys_config group by tab_value")
    List<String> findKeyList();

    @Select("select group_value from sys_config where tab_value=#{key} group by group_value")
    List<String> findByKey(String key);

    @Select("select * from sys_config where group_value = #{value}")
    List<SysConfig> findByValue(String value);
}
